import request from '@/utils/request'

export function leaveList(query) {
  return request({
    url: '/leaves',
    method: 'get',
    params: query
  })
}

export function leaveAdd(data) {
  return request({
    url: '/leave',
    method: 'post',
    data
  })
}

export function leaveDelete(id) {
  return request({
    url: `/leave/${id}`,
    method: 'delete'
  })
}

export function leaveUpdate(id, data) {
  return request({
    url: `/leave/${id}`,
    method: 'put',
    data
  })
}

export function leaveSubmit(id, data) {
  return request({
    url: `/leave/${id}/submit`,
    method: 'put',
    data
  })
}

export function leaveDrawback(id, data) {
  return request({
    url: `/leave/${id}/drawback`,
    method: 'put',
    data
  })
}
